from sklearn.cross_validation import cross_val_score
from sklearn.ensemble import ExtraTreesClassifier 
from sklearn.datasets import load_svmlight_file
import sys
X_train, y_train = load_svmlight_file(sys.argv[1])
X_test, y_test = load_svmlight_file(sys.argv[2])
clf = ExtraTreesClassifier(n_estimators=200, max_depth=None, min_samples_split=1)
#clf.set_params(warm_start=True)
X_dense=X_train.toarray()
X_test_dense = X_test.toarray()
clf.fit(X_dense,y_train)
print clf.score(X_test_dense, y_test)
#scores=cross_val_score(clf,X_dense,y_train) 
#print scores.mean()
